home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Screenblankers / GBlanker / GSource / Blankers / Executor / blank.c next >
C/C++ Source or Header  |  1996-09-26  |  1KB  |  54 lines

  1. /*
  2.  *  Copyright (c) 1994 Michael D. Bayne.
  3.  *  All rights reserved.
  4.  *
  5.  *  Please see the documentation accompanying the distribution for distribution
  6.  *  and disclaimer information.
  7.  */
  8.  
  9. #include <dos/dostags.h>
  10. #include <string.h>
  11. #include "/includes.h"
  12.  
  13. #include "Executor_rev.h"
  14. STATIC const UBYTE VersTag[] = VERSTAG;
  15.  
  16. extern CheckCPUDisabled;
  17.  
  18. VOID Defaults( PrefObject *Prefs )
  19. {
  20.     strcpy( Prefs[0].po_Value, "DisplayInfo Executor.hlp" );
  21.     strcpy( Prefs[2].po_Value, "Kill Command" );
  22. }
  23.  
  24. LONG Blank( PrefObject *Prefs )
  25. {
  26.     BPTR InFile, OutFile;
  27.     LONG RetVal;
  28.     
  29.     /* Since whatever we execute is likely to take up all the CPU we really
  30.        can't know whether our executed process or some other is taking up all
  31.        the CPU time so we bite the bullet and disable CPU checking entirely. */
  32.     CheckCPUDisabled = TRUE;
  33.  
  34.     InFile = Open( "NIL:", MODE_OLDFILE );
  35.     OutFile = Open( "NIL:", MODE_OLDFILE );
  36.     SystemTags( Prefs[0].po_Value, NP_Name, "!* StealthProcess *!",
  37.                SYS_Asynch, TRUE, SYS_Input, InFile, SYS_Output, OutFile,
  38.                TAG_END );
  39.  
  40.     do
  41.     {
  42.         Delay( 5 );
  43.         RetVal = ContinueBlanking();
  44.     }
  45.     while( RetVal == OK );
  46.  
  47.     InFile = Open( "NIL:", MODE_OLDFILE );
  48.     OutFile = Open( "NIL:", MODE_OLDFILE );
  49.     SystemTags( Prefs[2].po_Value, SYS_Asynch, TRUE, SYS_Input, InFile,
  50.                SYS_Output, OutFile, TAG_END );
  51.  
  52.     return RetVal;
  53. }
  54.